package cn.t222.ch04;

import cn.t222.ch04.mapper.BookMapper;
import cn.t222.ch04.pojo.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BookService {
    @Autowired
    private BookMapper bookMapper;

    public List<Book> getAll() {
        return bookMapper.getAll();
    }

    public int add(Book book) {
        return bookMapper.add(book);
    }
}
